package com.dz.reggie.common;

/**
 * 用于移动用户端
 * 用于ThreadLocal封装工具类，保存和获取当前登入用户id
 *   作用在单个线程内
 *
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }
}
